<?php
namespace Home\Controller;

use Think\Controller;

class LoginController extends Controller {
    public function register()
    {
        
        if (IS_POST) {
          
            $user = M('username');
           
            if (!$data = $user->create()) {
               
              
            }
            
            if ($user->add($data)) {
                
               
                $this->success('注册成功', U('Login/login'), 2);
            } else {
                $this->error('注册失败',U('Login/register'), 2);
            }
        } else {
            $this->display();
        }
    }
   /*   public  function register(){ 
            if(IS_POST){
                
               $username=I('post.username');
                $password=I('post.password');
                $tel=I('post.tel');
                $email=I('post.email');
                
                //$res=M('username')->add(I(post.));
            }
            $this->display();
               
        } */
            
    public function login(){
        
        $this->display();
        
    }
    
    function getCode(){
        $config=array(
            'fontSize'=>30,
            'length'=>4,
            'useNoise'=>false,//开启关闭杂点
        );
        $mycode=new Verify($config);//实例化参数
        $mycode->entry();
    }
}